/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sistemperpustakaan.tablemodel;

import java.util.List;
import javax.swing.table.AbstractTableModel;
import sistemperpustakaan.entity.TransaksiDetailView;

/**
 *
 * @author EKo
 */
public class TransaksiDetailTableModel extends AbstractTableModel {
    List<TransaksiDetailView> listDetailTransaksi;
    String[] header = {"ID Detail","ID Transaksi","ID Inventaris","Judul","Tanggal Pinjam","Tanggal Kembali","Terlambat","Denda"};

    public TransaksiDetailTableModel() {
    }

    public TransaksiDetailTableModel(List<TransaksiDetailView> listDetailTransaksi) {
        this.listDetailTransaksi = listDetailTransaksi;
    }

    public String[] getHeader() {
        return header;
    }

    public void setHeader(String[] header) {
        this.header = header;
    }

    public List<TransaksiDetailView> getListDetailTransaksi() {
        return listDetailTransaksi;
    }

    public void setListDetailTransaksi(List<TransaksiDetailView> listDetailTransaksi) {
        this.listDetailTransaksi = listDetailTransaksi;
    }
    


    public int getRowCount() {
        return listDetailTransaksi.size();
    }

    public int getColumnCount() {
        return 8;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        return listDetailTransaksi.get(rowIndex).getObject(columnIndex);
    }

    @Override
    public String getColumnName(int column) {
        return header[column];
    }

}
